package com.yungu.swift.schedule.job;

import com.yungu.swift.schedule.service.impl.DrawGiftService;
import org.quartz.DisallowConcurrentExecution;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import org.quartz.PersistJobDataAfterExecution;
import org.springframework.scheduling.quartz.QuartzJobBean;

import static com.yungu.swift.schedule.utils.QuartzContextUtils.getApplicationContext;

/***
 * @Description
 *  统计连续叫单不成功用户定时任务（集群配置）
 * @author Zerrion
 * @date 2019/01/03 19:44
 * @return
 */
@PersistJobDataAfterExecution
// 不允许并发执行
@DisallowConcurrentExecution
public class DrawGiftCountAlwaysNotSuccessOrderPassengerJob extends QuartzJobBean {

    @Override
    protected void executeInternal(JobExecutionContext jobExecutionContext) throws JobExecutionException {
        DrawGiftService drawGiftService = getApplicationContext(jobExecutionContext).getBean(DrawGiftService.class);
        drawGiftService.countAlwaysNotSuccessOrderPassenger();
    }

}
